import { handle } from '../../index'

const suffix = 'api'

// 带条件分页查询索引信息
export const sysIndexFindIndexByPage = (params: any) => handle({
  url: `/${suffix}/sys-index/findIndexByPage`,
  method: 'get',
  params
})
// 新增||编辑
export const sysIndexSaveOrUpdate = (params: any) => handle({
  url: `/${suffix}/sys-index/saveOrUpdate`,
  method: 'post',
  params
})
// 详情
export const sysIndexGetDetail = (id: any) => handle({
  url: `/${suffix}/sys-index/getDetail/${id}`,
  method: 'get',
})
// 关联分类
export const sysIndexFindAllByIndexId = (id: any) => handle({
  url: `/${suffix}/sys-index/findAllByIndexId/${id}`,
  method: 'get',
})
// 创建索引关联分类
export const sysIndexCreate = (params: any) => handle({
  url: `/${suffix}/sys-index/create`,
  method: 'post',
  params
})
// 删除索引关联分类
export const sysIndexDeleteByLinkId = (id: any) => handle({
  url: `/${suffix}/sys-index/deleteByLinkId/${id}`,
  method: 'get',
})
// 索引id查询字段列表信息
export const sysIndexFieldList = (params: any) => handle({
  url: `/${suffix}/sys-index-field/list`,
  method: 'get',
  params
})
// 新增或修改索引字段信息
export const sysIndexFieldSaveOrUpdate = (params: any) => handle({
  url: `/${suffix}/sys-index-field/saveOrUpdate`,
  method: 'post',
  params
})
// 根据ID删除索引字段信息
export const sysIndexFieldDeleteById = (id: any) => handle({
  url: `/${suffix}/sys-index-field/deleteById/${id}`,
  method: 'get',
})
// 删除
export const sysIndexDeleteIndexById = (id: any) => handle({
  url: `/${suffix}/sys-index/deleteIndexById/${id}`,
  method: 'get',
})
// 导出
export const sysIndexExport = (params: any) => handle({
  url: `/${suffix}/sys-index/export`,
  method: 'get',
  params
})
// 关联主题-保存
export const sysIndexSaveThemeInfo = (params: any) => handle({
  url: `/${suffix}/sys-index/saveThemeInfo`,
  method: 'post',
  params
})
// 关联主题-查询
export const sysIndexGetThemeByIndex = (id: any) => handle({
  url: `/${suffix}/sys-index/getThemeByIndex/${id}`,
  method: 'get',
})
// 创建索引
export const sysIndexCreateEsIndex = (code: any) => handle({
  url: `/${suffix}/sys-index/createEsIndex/${code}`,
  method: 'get',
})
